package com.self.cgqcompose.ui.components.areacode

import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.self.cgqcompose.beans.AreaBlock
import com.self.cgqcompose.beans.BlockData
import com.self.cgqcompose.beans.Config
import com.self.cgqcompose.beans.Label
import com.self.cgqcompose.beans.More
import com.self.cgqcompose.beans.Params
import com.self.cgqcompose.beans.SubLabel

@Composable
fun AreaUnSupport(data: AreaBlock) {
    Box(modifier = Modifier
        .fillMaxWidth()
        .aspectRatio(16 / 9f)
        .border(1.dp, Color.Gray),
        contentAlignment = androidx.compose.ui.Alignment.Center) {
        Text("unsupport area ${data.data.areaCode}",
            modifier = Modifier.fillMaxWidth().align(androidx.compose.ui.Alignment.Center),
            textAlign = androidx.compose.ui.text.style.TextAlign.Center)

    }
}

@Preview
@Composable
fun AreaUnSupportPreview() {
    AreaUnSupport(
        AreaBlock(
            0,
            "",
            BlockData(
                0,
                "",
                "",
                emptyList(),
                emptyList(),
                emptyList(),
                0,
                Config(0, "", "", 0),
                emptyList(),
                Label(""),
                More("", "", 0, 0, "", 0, "", "0", 0, ""),
                Params("", 0),
                SubLabel(0, 0),
                0
            ),
            0,
            "",
            ""
        )
    )
}